import java.util.Objects;

class Poker
{
    String shape;
    int val;

    public Poker(String shape, int val) {
        this.shape = shape;
        this.val = val;
    }

    @Override
    public String toString() {
        return "Poker{" +
                "shape='" + shape + '\'' +
                ", val=" + val +
                '}';
    }


    /*public boolean equals(Object o) {
        if (this == o)
            return true;
        if(o==null)
        {
            return false;
        }
        Poker a=(Poker)o;
        return this.shape.equals(a.shape)&&this.val==a.val;
    }

     */

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Poker poker = (Poker) o;
        return val == poker.val && Objects.equals(shape, poker.shape);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shape, val);
    }
}






public class text91 {
    public static void main(String[] args) {
        Poker a=new Poker("♠",1);
        Poker b=new Poker("♣",1);
        System.out.println(a.equals(b));


    }
}
